package restful.struts2.app2;

import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;

import org.junit.*;

import restful.struts2.*;

public class Utf8IT extends ProtocolIT {

	@BeforeClass
	public static void setUpClass() throws Exception {
		start("app2");
	}

	@Test
	public void testEchoProtocolIsDefined() throws Exception {
		GET("/protocol.txt");
		assertThat(status, is(equalTo(200)));
		assertThat(content, containsString("GET /string"));
	}

	@Test
	public void testGetUtf8() throws Exception {
		GET("/string.json");
		assertThat(status, is(equalTo(200)));
		assertThat(headers, hasHeader("Content-Type", "text/javascript; charset=utf-8"));
		assertThat(content, containsString("Zürich"));
	}
}
